<?php

/**
 * OpeningEnding form base class.
 *
 * @package    form
 * @subpackage opening_ending
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
 */
class BaseOpeningEndingForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'        => new sfWidgetFormInputHidden(),
      'video_id'  => new sfWidgetFormPropelSelect(array('model' => 'Video', 'add_empty' => false)),
      'tipo'      => new sfWidgetFormInput(),
      'direccion' => new sfWidgetFormInput(),
      'orden'     => new sfWidgetFormInput(),
      'titulo'    => new sfWidgetFormInput(),
      'grupo'     => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'        => new sfValidatorPropelChoice(array('model' => 'OpeningEnding', 'column' => 'id', 'required' => false)),
      'video_id'  => new sfValidatorPropelChoice(array('model' => 'Video', 'column' => 'id')),
      'tipo'      => new sfValidatorString(array('max_length' => 1)),
      'direccion' => new sfValidatorString(array('max_length' => 255)),
      'orden'     => new sfValidatorInteger(array('required' => false)),
      'titulo'    => new sfValidatorString(array('max_length' => 250)),
      'grupo'     => new sfValidatorString(array('max_length' => 250)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'OpeningEnding', 'column' => array('direccion')))
    );

    $this->widgetSchema->setNameFormat('opening_ending[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'OpeningEnding';
  }


}
